#include "CSlideRule.h"

CSlideRule::CSlideRule()
{
    int i;
    m_lpdblTicks1 = new double[10];
    for (i = 0; i < 10; ++i)
    {
        m_lpdblTicks1[i] = std::log(double((i + 1) * 10));
    }
    m_lpdblTicks2 = new double[12];
    for (i = 0; i < 4; ++i)
    {
        m_lpdblTicks2[i] = std::log(double((i + 1) * 10 + 5));
    }
    for (i = 2; i < 10; ++i)
    {
        m_lpdblTicks2[i + 2] = std::log(double(i));
    }
    m_lpdblTicks3 = new double[50];
    for (i = 0; i < 25; ++i)
    {
        m_lpdblTicks3[i] = std::log(double((i + 1) * 2 + 50));
    }
    for (i = 0; i < 25; ++i)
    {
        m_lpdblTicks3[i + 25] = std::log((i + 1) * 0.2 + 5);
    }
    m_lpdblTicks4 = new double[80];
    for (i = 0; i < 40; ++i)
    {
        m_lpdblTicks4[i] = std::log(double(i + 11));
    }
    for (i = 0; i < 40; ++i)
    {
        m_lpdblTicks4[i + 40] = std::log(1 + (i + 1) * 0.1);
    }
    m_lpdblTicks5 = new double[30];
    for (i = 0; i < 15; ++i)
    {
        m_lpdblTicks5[i] = std::log(10 + (i * 2 + 1) * 0.5);
    }
    for (i = 0; i < 15; ++i)
    {
        m_lpdblTicks5[i + 15] = std::log(1 + (i * 2 + 1) * 0.05);
    }
    m_iFactor = 150;
    m_iProduct = 37500;
    //ctor
}

CSlideRule::~CSlideRule()
{
    delete[]m_lpdblTicks5;
    delete[]m_lpdblTicks4;
    delete[]m_lpdblTicks3;
    delete[]m_lpdblTicks2;
    delete[]m_lpdblTicks1;
}

